package com.example;

import java.util.Arrays;

public class MethodInvoke {
    public static void main(String[] args) {

        System.out.println(-10>>2);

        int m=10;
        int n=20;
        m=n^(n=m)^m;
        System.out.println(m);
        System.out.println(n);

        int a=10;
        int b=20;

        change(a,b);
        System.out.println("main-a:"+a);
        System.out.println("main-b:"+b);

        int []arr={1,2,3,4,5};
        add(arr);
        System.out.println("main->"+ Arrays.toString(arr));


    }

    private static void add(int[] arr) {
        for(int i=0;i<arr.length;i++){
            arr[i]+=10;
        }
        System.out.println(Arrays.toString(arr));
    }

    private static void change(int a, int b) {  //形参-无实际值

        a=a^b;
        b=b^a;
        a=a^b;
        System.out.println("change-a："+a);
        System.out.println("change-b："+b);
    }
}
